<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0">
    <title>{$web_name}-注册帐号</title>
    <link rel="shortcut icon" href="assets/img/favicon.png">
    <link rel="stylesheet" href="__HOME__/static/home/css/bootstrap.min.css">
    <link rel="stylesheet" href="__HOME__/static/home/css/style-no.css">
</head>
<body>

<!-- Main Wrapper -->
<div class="main-wrapper login-body">
    <div class="login-wrapper">
        <div class="container">

            <img class="img-fluid logo-dark mb-2" src="__HOME__/static/index/img/logo.png" alt="Logo">
            <div class="loginbox">

                <div class="login-right">
                    <div class="login-right-wrap">
                        <h1>登录</h1>
                        <p class="account-subtitle">享用更多功能</p>

                        <form id="oreoDataAddForm" action="" method="post">
                            <div class="form-group">
                                <label class="form-control-label"><a id="target_name"></a></label>
                                <input type="email" class="form-control" name="is_target">
                            </div>
                            <div class="form-group">
                                <label class="form-control-label">密码</label>
                                <div class="pass-group">
                                    <input type="password" class="form-control pass-input" name="password">
                                    <span class="fas fa-eye toggle-password"></span>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="row">
                                    <div class="col-6">
                                        <div class="custom-control custom-checkbox">
                                            <input type="checkbox" class="custom-control-input" id="cb1">
                                            <label class="custom-control-label" for="cb1">记住我</label>
                                        </div>
                                    </div>
                                    <div class="col-6 text-right">
                                        <a class="forgot-link" href="login/resetPassword.html">忘记密码 ?</a>
                                    </div>
                                </div>
                            </div>
                            <button class="btn btn-lg btn-block btn-primary" type="button" onclick="shortDomain()">登录</button>
                            <!--<div class="login-or">
                                <span class="or-line"></span>
                                <span class="span-or">or</span>
                            </div>
                            <div class="social-login mb-3">
                                <span>Login with</span>
                                <a href="#" class="facebook"><i class="fab fa-facebook-f"></i></a><a href="#" class="google"><i class="fab fa-google"></i></a>
                            </div>-->
                            <!-- /Social Login -->
                            <div class="text-center dont-have">没有帐号? <a href="register.html">立即注册</a></div>
                        </form>

                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- /Main Wrapper -->

<!-- jQuery -->
<script src="__HOME__/static/layuiadmin/jquery.min.js"></script>
<script src="__HOME__/static/index/js/sweetalert.min.js"></script>
<script>
    let trg_name = {$system_sms};
    if(trg_name == 1){
        $("#target_name").html('邮箱');
    }else{
        $("#target_name").html('手机号码');
    }
    function shortDomain(){
        $.ajax({
            type: "POST",
            url:'{fun:ctr("checkLogin")}',
            data: $('#oreoDataAddForm').serialize(),
            dataType: 'json',
            success : function(res) {
                if(res.code == 200){
                    swal(res.msg, {
                        icon: "success",
                    }).then(function () {
                        window.setTimeout(function () {
                            top.location = '{fun:ctr("../Index")}';
                        }, 1000);
                    });
                } else {
                    return swal("发生错误!", res.msg, "error");
                }
            }
        });
    }
</script>
</body>
</html>